﻿#include "DAAppCore.h"
#include "DAAppUI.h"
#include "DAAppRibbonArea.h"
#include "DAAppDataManager.h"
//===================================================
// using DA namespace -- 禁止在头文件using！！
//===================================================

using namespace DA;

//===================================================
// DAAppCore
//===================================================
DAAppCore::DAAppCore(QObject* p) : DACoreInterface(p), m_appUI(nullptr), m_isPythonInterpreterInitialized(false)
{
    m_dataManager = new DAAppDataManager(this, this);
}

DAAppCore& DAAppCore::getInstance()
{
    static DAAppCore s_core;
    return (s_core);
}

DAAppUIInterface* DAAppCore::getUiInterface() const
{
    return m_appUI;
}

void DAAppCore::createUi(SARibbonMainWindow* mainwindow)
{
    m_appUI = new DAAppUI(mainwindow, this);
}

/**
 * @brief python内核是否初始化成功
 * @return
 */
bool DAAppCore::isPythonInterpreterInitialized() const
{
    return m_isPythonInterpreterInitialized;
}

DADataManagerInterface* DAAppCore::getDataManagerInterface() const
{
    return m_dataManager;
}

void DAAppCore::setPythonInterpreterInitializedMode(bool on)
{
    m_isPythonInterpreterInitialized = on;
}
